import request from '@/config/axios'

// 月度工资明细 VO
export interface HrSalaryMonthlyVO {
  id: number // 主键ID
  salaryNo: string // 工资单编号
  userId: string // 员工ID
  userName: string // 员工姓名
  deptId: string // 部门ID
  deptName: string // 部门名称
  yearMonthValue: string // 工资月份
  baseSalary: number // 基本工资
  positionSalary: number // 岗位工资
  senioritySalary: number // 工龄工资
  performanceSalary: number // 绩效工资
  bonus: number // 奖金
  mealAllowance: number // 餐补
  transportAllowance: number // 交通补贴
  communicationAllowance: number // 通讯补贴
  housingAllowance: number // 住房补贴
  otherAllowance: number // 其他补贴
  attendanceDeduction: number // 考勤扣款
  otherDeduction: number // 其他扣款
  socialInsurance: number // 社保个人部分
  housingFund: number // 公积金个人部分
  taxableIncome: number // 应纳税所得额
  personalTax: number // 个人所得税
  netSalary: number // 实发工资
  salaryStatus: number // 状态
  paymentDate: Date // 发放日期
  paymentMethod: number // 发放方式
  bankAccount: string // 银行账号
  bankName: string // 开户银行
  remark: string // 备注
  status: number // 审批结果
}

// 月度工资明细 API
export const HrSalaryMonthlyApi = {
  // 查询月度工资明细分页
  getHrSalaryMonthlyPage: async (params: any) => {
    return await request.get({ url: `/bpm/hr-salary-monthly/page`, params })
  },

  // 查询月度工资明细详情
  getHrSalaryMonthly: async (id: number) => {
    return await request.get({ url: `/bpm/hr-salary-monthly/get?id=` + id })
  },

  // 新增月度工资明细
  createHrSalaryMonthly: async (data: HrSalaryMonthlyVO) => {
    return await request.post({ url: `/bpm/hr-salary-monthly/create`, data })
  },

  // 修改月度工资明细
  updateHrSalaryMonthly: async (data: HrSalaryMonthlyVO) => {
    return await request.put({ url: `/bpm/hr-salary-monthly/update`, data })
  },

  // 删除月度工资明细
  deleteHrSalaryMonthly: async (id: number) => {
    return await request.delete({ url: `/bpm/hr-salary-monthly/delete?id=` + id })
  },

  // 导出月度工资明细 Excel
  exportHrSalaryMonthly: async (params) => {
    return await request.download({ url: `/bpm/hr-salary-monthly/export-excel`, params })
  },
}
